﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace ZoneLine.ViewModels
{
    public class ViewModelBase : ObservableObject
    {

        private LoadingModel _loadingModel = new LoadingModel();

        public LoadingModel LoadingModel
        {
            get { return _loadingModel; }
            set => SetProperty(ref _loadingModel, value);
        }

        public bool ShowMsg(string msg, bool wait = false)
        {
            var rlt = MessageBox.Show(msg, "软件提示", MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.None, MessageBoxOptions.ServiceNotification);
            if (wait)
            {
                return rlt == MessageBoxResult.OK && true;
            }
            else
            {
                return true;
            }
        }
        public bool GetConfirmRlt(string msg)
        {
            //var rlt = MessageBox.Show(App.Current.MainWindow, msg, "提示", MessageBoxButton.YesNo);
            var rlt = MessageBox.Show(msg, "提示", MessageBoxButton.YesNo);
            return rlt == MessageBoxResult.Yes;

        }
    }
}
